/**
 * Stuff needed by all of kig.
 */

#include <cassert>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>

#include <osg/ref_ptr>
#include <osg/Object>
#include <osg/Vec4f>

#ifndef KIG_UTIL_H
#define KIG_UTIL_H

#ifdef DEBUG 
#define	ASSERT(cond)	kig::verify((cond), __LINE__, __FILE__)
#else
#define ASSERT(cond)
#endif

#define REF_POINTER(c,name) typedef osg::ref_ptr<c> name; 

namespace kig 
{
	typedef float Float;
	typedef osg::Vec4f Vec4;
	typedef osg::Referenced Referenced;

	/**
	 * Exit if cond is not true.
	 * @param cond must be true to return
	 * @param line the source line 
	 * @param file the source file 
	 */
	void verify(bool cond, int line, const char* file);

	/**
	 * Base class for all "important" classes.
	 * Defines useful functions.
	 */
	class Object : public Referenced
	{
		public:
			/**
			 * Return a description of this instance.
			 */
			virtual std::string getDesc() const = 0;

			/**
			 * Destructor.  Does nothing.
			 */
			virtual ~Object() { }
	};
}

/**
 * Output the Object's description.
 */
std::ostream& operator<<(std::ostream& os, const kig::Object* obj);



#endif
